<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en" style="
    margin-left: -182px;
    margin-top:  -88px;
">
<head>
	<meta charset="UTF-8">
	<title>editpass</title>
	<link href="/font/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/font/css/common.css" rel="stylesheet" type="text/css" />
   
    <style type="text/css">
	.fmright{
		margin-left: 200px;
		margin-top: 100px;
		float: left;
	}
    </style>
    <script src="${pageContext.request.contextPath}/back/jquery/jquery-1.8.3.js"
	type="text/javascript"></script>
	<script>
		$(function(){
			$("#former").blur(function(){
				
				var upass=$("#old").val();
				var inpass=$("#former").val();
				if(upass!=inpass){
					$("#tishi").html("<font color='red'>原始密码错误</font>");
					$("#sub").attr("disabled", true); 
				}else{
					$("#tishi").html("<font color='green'>ok</font>");
					$("#sub").attr("disabled", false);
				}
				
			});
			$("#pass").blur(function(){
				var former=$("#former").val();
				var pa=$("#pass").val();
				if(former==pa){
					$("#tishi1").html("<font color='red'>新旧密码一样</font>");
					$("#sub").attr("disabled", true); 
				}else{
					$("#tishi1").html("<font color='green'>ok</font>");
					$("#sub").attr("disabled", false);
				}
			});
			$("#password").blur(function(){
				var pass=$("#pass").val();
				var password=$("#password").val();
				if(pass!=password){
					$("#tishi2").html("<font color='red'>两次输入不一致！</font>");
					$("#sub").attr("disabled", true); 
				}else{
					$("#tishi2").html("<font color='green'>ok</font>");
					$("#sub").attr("disabled", false);
				}
			});
			$("#sub").bind("click",function(){
				alert(111);
				if($("#former").val()==""){
					alert("原始密码不能为空")
					return false;
				}
				if($("#pass").val()==""){
					alert("新密码不能为空")
					return false;
				}
				
				if($("#password").val()==""){
					alert("确认密码不能为空")
					return false;
				}
				
				$("#form").submit();
			});
				
		});
	</script>
</head>
<body>   	
 	<div class="fmright">
        	<div class="fmr1">
            	<div class="fmr1_top">修改密码</div>
                <div class="fmr1_m">
                	<div class="fcard">
                	<form id="form" action="${pageContext.request.contextPath}/VipPassServlet" method="post">
                    	<table border="0" cellpadding="0" cellspacing="0" width="636">                  	
                        	<tr>
                        	                       	
                            	<td align="right" height="30"> <input type="hidden" id="old" value="${usertable.getUpass() }">请输入账号当前的密码：</td>
                                <td align="left" height="30"><input type="password" name="forpass" id="former" class="finput3">
                                	<div id="tishi" style=" display:inline;"></div>
                                </td>                               
                            </tr>
                            <tr>
                            	<td align="right"  height="30">请输入要修改的密码：</td>
                                <td align="left" height="30"><input type="password" name="pass" id="pass" class="finput3">
                                	<div id="tishi1" style=" width:300px; display:inline;"></div>
                                </td>
                            </tr>
                            <tr>
                            	<td align="right" height="30">请确认要修改的密码：</td>
                                <td align="left" height="30"><input type="password" id="password" class="finput3">
                                	<div id="tishi2" style=" display:inline;"></div>
                                </td>
                            </tr>
                            <tr>
                            	<td colspan="2" align="center" valign="middle" height="50"><input type="image" id="sub" src="/font/images/fbtn8.png"></td>
                            </tr>
                        </table>
                        </form>
                    </div>
                    
            </div>
        </div>
    </div>
</body>
</html>